/**
 * 
 */
package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * @author chenkai 14-08-10  
 */
public enum ReversalType {
	//状态 0 正常 5 被撤销 2 被冲正
	 OK("正常", "0"),
	 CANCEL("被撤销", "5"),
	 CHONG_ZHEN("被冲正","2"),
	 WAIT_CHONG("冲正失败","1");
	  
	 
	private String code;
	private String name;
	private boolean editAble;
	private boolean enabled;

	private ReversalType( String name,String code) {
		this.code = code;
		this.name = name;
		
	}

	public boolean isEditAble() {
		return editAble;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static ReversalType valueOfCode(String code) {
		if (StringUtils.isBlank(code)) {
			throw new IllegalArgumentException("SysLogType code " + code
					+ " is blank");
		}
		for (ReversalType ms : values()) {
			if (ms.getCode().equals(code)) {
				return ms;
			}
		}
		throw new IllegalArgumentException("SysLogType code " + code
				+ " is not exist");
	}

}
